package guicommon.controls;

import guicommon.gui.ButtonMessage;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.swing.JButton;
import javax.swing.JPanel;

public class Button extends Control {

    private JButton button;

    public Button() {
        super();
        button = new JButton();
    }

    public void SetText(String text) {
        Update("SetText", text);
        button.setText(text);
    }

    public String GetText() {
        return button.getText();
    }

    protected Component GetComponent() {
        return button;
    }

    @Override
    public ButtonMessage ToMessage() {
        ButtonMessage result = new ButtonMessage();
        SetCommonFields(result);
        result.SetText(GetText());
        return result;
    }

}
